package com.jie.jie.svg;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.View;

import java.text.ParseException;

/**
 * Created by Administrator on 2017/3/10.
 */

public class TestView extends View {
    public TestView(Context context) {
        super(context);
    }

    public TestView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public TestView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        PathUtils utils = new PathUtils();
        Path[] path = new Path[GAStudioPath.STUDIO_PATH.length];
        Paint paint = new Paint();
        paint.setColor(0xff000000);
        for (int i = 0;i<GAStudioPath.STUDIO_PATH.length;i++) {

            try {
                path[i] = utils.parsePath(GAStudioPath.STUDIO_PATH[i]);
                canvas.drawPath(path[i],paint);
            } catch (ParseException e) {
                e.printStackTrace();
            }
        }
    }
}
